/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.repair.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.modules.repair.dto.BuildingSelectSearchDTO;
import org.springblade.modules.repair.entity.Building;
import org.springblade.modules.repair.entity.BuildingExt;
import org.springblade.modules.repair.vo.*;
import org.springblade.modules.repair.vo.plan.SignRangeVo;
import org.springblade.modules.repair.vo.rescue.MapRescueBuildingDetailVO;
import org.springblade.modules.repair.vo.statistics.ChartItemVO;
import org.springblade.modules.repair.vo.statistics.PieChartVO;

import java.util.List;

/**
 * 楼盘信息 服务类
 *
 * @author BladeX
 * @since 2021-05-21
 */
public interface IBuildingService extends BaseService<Building> {


	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param building
	 * @return
	 */
	IPage<BuildingVO> selectBuildingPage(IPage<BuildingVO> page, BuildingVO building);

    List<ListBuildingVO> listBuilding(String buildingName);

	BuildingSubmitVO buildingSubmitVOR(Long buildingId);

	/**
	 * 维保小区电梯列表
	 * @param search
	 * @return
	 */
	IPage<BuildingSelectVO> myMaintainBuilding(BuildingSelectSearchDTO search, IPage<BuildingSelectVO> page);

	/**
	 * 维保小区电梯列表
	 * @param search
	 * @return
	 */
	List<ElevatorSelectVO> myMaintainBuildingChild(BuildingSelectSearchDTO search);

	/**
	 * 维保小区统计
	 * @return
	 */
	MyElevatorStatisticsVO myElevatorStatistics(BuildingSelectSearchDTO search);

	/**
	 * 项目统计-项目合同-即将到期项目
	 * @param userIds
	 * @return
	 */
	PieChartVO comingExpiryProject(List<Long> userIds);

	/**
	 * 项目统计-项目合同-已到期项目
	 * @param userIds
	 * @return
	 */
	PieChartVO expiryProject(List<Long> userIds);

	/**
	 * 项目统计-电梯统计
	 * @param userIds
	 * @return
	 */
	PieChartVO projectElevator(List<Long> userIds);

	/**
	 * 项目统计-年审梯/非年审梯统计
	 * @return
	 */
	List<ChartItemVO> projectElevatorUseType(List<Long> userIds);

	/**
	 * 项目统计-品牌
	 * @return
	 */
	PieChartVO brandElevator(List<Long> userIds);

	/**
	 * 获取所有项目的经纬度
	 * @return 数据集
	 */
	List<SignRangeVo> getBuildingSignList();

	/**
	 * 我的电梯-个人管理电梯-小区项目列表
	 * @param search
	 * @param page
	 * @return
	 */
	IPage<PrincipalBuildingListVO> personalBuildingList(BuildingSelectSearchDTO search, IPage<PrincipalBuildingListVO> page);

	/**
	 * 我的电梯-个人管理电梯-小区项目电梯
	 * @param search
	 * @return
	 */
	List<PrincipalElevatorListVO> personalElevatorList(BuildingSelectSearchDTO search);

	/**
	 * 我的电梯-部门管理电梯-小区项目列表
	 * @param search
	 * @param page
	 * @return
	 */
	IPage<PrincipalBuildingListVO> deptBuildingList(BuildingSelectSearchDTO search, IPage<PrincipalBuildingListVO> page);

	/**
	 * 我的电梯-部门管理电梯-小区项目电梯
	 * @param search
	 * @return
	 */
	List<PrincipalElevatorListVO> deptElevatorList(BuildingSelectSearchDTO search);

	/**
	 * 我的电梯-统计
	 * @param search
	 * @return
	 */
	MyElevatorStatisticsVO principalBuildingStatistics(BuildingSelectSearchDTO search);

	/**
	 * 获取当前维保公司所有项目列表
	 * @param page 分页信息
	 * @param search 搜索条件
	 * @return 项目分页列表
	 */
	IPage<BuildingSelectVO> getBuildingList(IPage<BuildingSelectVO> page,BuildingSelectSearchDTO search);

	/**
	 * 获取缓存所需列表信息
	 * @return 缓存所需VO
	 */
    List<BuildingRedisVO> listForVO();


	BuildingExt selectBuildingExtDetail(Long buildingId);

	/**
	 * 创建救援工单-小区项目列表选择
	 * @param search
	 * @param page
	 * @return
	 */
	IPage<BuildingSelectVO> rescueBuildingList(BuildingSelectSearchDTO search, IPage<BuildingSelectVO> page);

	/**
	 * 创建救援工单-电梯列表选择
	 * @param search
	 * @param page
	 * @return
	 */
	IPage<ElevatorSelectVO> rescueElevatorList(BuildingSelectSearchDTO search, IPage<ElevatorSelectVO> page);

	MapRescueBuildingDetailVO selectMapRescueBuildingDetail(Long buildingId);
}
